/**
 * <p>Title: ServiceZMCME2.java</p>
 * <p>Description: </p>
 * <p>Copyright: Baosight Software LTD.co Copyright (c) 2002</p>
 * <p>Company: Baosight Software</p>
 * @author 余虎
 * @version 1.0
 * <pre>Histroy:
 *          2011-7-13 上午09:19:44  余虎  Create
 *</pre>
 */
package com.baosight.sczx.zm.cm.service;

import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.ep.ServiceEPBase;
import com.baosight.sczx.common.zm.basetools.StaticTools;
import com.baosight.sczx.common.zm.cInterface.cs.InitialData;
import com.baosight.sczx.zm.cm.domain.ZMCMExportmaterialDetail;

/**
 * <p>Title: ServiceZMCME2.java</p>
 * <p>Description: </p>
 * <p>Copyright: Baosight Software LTD.co Copyright (c) 2002</p>
 * <p>Company: Baosight Software</p>
 * @author 余虎
 * @version 1.0
 * <pre>Histroy:
 *          2011-7-13 上午09:19:44  余虎  Create
 *</pre>
 */
public class ServiceZMCME2 extends ServiceEPBase {

	/**
	 * <p>Function: initLoad</p>
	 * <p>Description: </p>
	 * <p>return value: ServiceZMCME2</p>
	 * <p>throws Exception:</p>
	 * <p>History:
	 *    2011-7-13上午09:21:08 余虎
	 * </p>
	 *
	*/
	@Override
	public EiInfo initLoad(EiInfo inInfo) {
		inInfo.addBlock(EiConstant.resultBlock).set("showCount", "true");//如果不加这个，翻页的统计和显示是错误的
		EiInfo outInfo = this.query(inInfo);
		
		return outInfo;
	}

	/**
	 * <p>Function: query</p>
	 * <p>Description: </p>
	 * <p>return value: ServiceZMCME2</p>
	 * <p>throws Exception:</p>
	 * <p>History:
	 *    2011-7-13上午09:21:08 余虎
	 * </p>
	 *
	*/
	public EiInfo query(EiInfo inInfo) {
		String fdExportmaterialId = inInfo.getString("fdExportmaterialId");
		StaticTools.setQueryParameters(inInfo, "fdExportmaterialId", fdExportmaterialId, true);//添加查询条件
		EiInfo outInfo = super.query(inInfo, "ZMCMExportmaterialDetail.query", new ZMCMExportmaterialDetail());	
		outInfo.addBlock(InitialData.getInstance().getEiBlockByNo("cmes.cs.units"));
		return outInfo;
	}

}
